<?php

/*
=====================================================
 FluxBB - Delux Board Converstations (DBC)
-----------------------------------------------------
 http://dbc-forum.com/
 http://fluxbb.org/
-----------------------------------------------------
 Copyright (c) 2010,2011 FluxBB - Delux Board Conversations (DBC)
-----------------------------------------------------
 Предсловие: Данный скрипт (DBC) не является работой с нуля, то 
 есть ядром скрипта всё также остаётся FuxBB,но теперь в оболочке
 DBC.
=====================================================
*/

// The Delux Board Conversations version this script installs
define('FORUM_VERSION', '1.5');

define('FORUM_VER_REVISION', 1);

define('FORUM_DB_REVISION', 8);
define('FORUM_SI_REVISION', 1);
define('FORUM_PARSER_REVISION', 1);

define('MIN_PHP_VERSION', '4.3.0');
define('MIN_MYSQL_VERSION', '4.1.2');
define('MIN_PGSQL_VERSION', '7.0.0');
define('DBC_SEARCH_MIN_WORD', 3);
define('DBC_SEARCH_MAX_WORD', 20);


define('DBC_ROOT', './');

if (file_exists(DBC_ROOT.'engine/data/config.php'))
{
	// Check to see whether Delux Board Conversations is already installed
	include DBC_ROOT.'engine/data/config.php';

	// If we have the 1.3-legacy constant defined, define the proper 1.4 constant so we don't get an incorrect "need to install" message
	if (defined('FORUM'))
		define('DBC', FORUM);

	// If DBC is defined, config.php is probably valid and thus the software is installed
	if (defined('DBC'))
		exit('<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="templates/Default/css/style.css" />
<title>Delux Board Conversations Installation</title>
<link rel="shortcut icon" href="favicon.ico" />
<DBC_head>
</head>

<body>

<div id="DBCredirect" class="DBC_2">
<div class="top-box"><div><!-- Top Corners --></div></div>
<div class="DBCwrap">

<div id="brdmain">
			<h1><span>Delux Board Conversations 1.5</span></h1>
			<div id="brddesc"><p>Ваш форум под управлением Delux Board Conversations уже установлен. Вы можете перейти <a href="index.php">на главную</a> страницу.</p></div><br/>
			<div id="brddesc" style="font-style: italic;">В случае возникновения проблем просьба обратиться на <a href="http://dbc-forum.com/support/" target="_blank">форум поддержки DBC</a>.</div>
</div>

<DBC_footer>

</div>
<div class="end-box"><div><!-- Bottom Corners --></div></div>
</div>

</body>
</html>');
}

// Define DBC because email.php requires it
define('DBC', 1);

// Make sure we are running at least MIN_PHP_VERSION
if (!function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
	exit('You are running PHP version '.PHP_VERSION.'. Delux Board Conversations '.FORUM_VERSION.' requires at least PHP '.MIN_PHP_VERSION.' to run properly. You must upgrade your PHP installation before you can continue.');

// Load the functions script
require DBC_ROOT.'engine/functions.php';

// Load UTF-8 functions
require DBC_ROOT.'engine/utf8/utf8.php';

// Strip out "bad" UTF-8 characters
forum_remove_bad_characters();

// Reverse the effect of register_globals
forum_unregister_globals();

// Disable error reporting for uninitialized variables
error_reporting(E_ALL);

// Force POSIX locale (to prevent functions such as strtolower() from messing up UTF-8 strings)
setlocale(LC_CTYPE, 'C');

// Turn off magic_quotes_runtime
if (get_magic_quotes_runtime())
	set_magic_quotes_runtime(0);

// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
if (get_magic_quotes_gpc())
{
	function stripslashes_array($array)
	{
		return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
	}

	$_GET = stripslashes_array($_GET);
	$_POST = stripslashes_array($_POST);
	$_COOKIE = stripslashes_array($_COOKIE);
	$_REQUEST = stripslashes_array($_REQUEST);
}

// Turn off PHP time limit
@set_time_limit(0);

//
// Generate output to be used for config.php
//
function generate_config_file()
{
	global $db_type, $db_host, $db_name, $db_username, $db_password1, $db_prefix, $cookie_name, $cookie_seed;

	return '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.addslashes($db_name)."';\n".'$db_username = \''.addslashes($db_username)."';\n".'$db_password = \''.addslashes($db_password1)."';\n".'$db_prefix = \''.addslashes($db_prefix)."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'".$cookie_name."';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.random_key(16, false, true)."';\n\ndefine('DBC', 1);\n";
}


if (isset($_POST['generate_config']))
{
	header('Content-Type: text/x-delimtext; name="config.php"');
	header('Content-disposition: attachment; filename=config.php');

	$db_type = $_POST['db_type'];
	$db_host = $_POST['db_host'];
	$db_name = $_POST['db_name'];
	$db_username = $_POST['db_username'];
	$db_password1 = $_POST['db_password1'];
	$db_prefix = $_POST['db_prefix'];
	$cookie_name = $_POST['cookie_name'];
	$cookie_seed = $_POST['cookie_seed'];

	echo generate_config_file();
	exit;
}


if (!isset($_POST['form_sent']))
{
	// Make an educated guess regarding base_url
	$base_url  = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';	// protocol
	$base_url .= preg_replace('/:(80|443)$/', '', $_SERVER['HTTP_HOST']);							// host[:port]
	$base_url .= str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));							// path

	if (substr($base_url, -1) == '/')
		$base_url = substr($base_url, 0, -1);

	$db_type = $db_name = $db_username = $username = $email = '';
	$db_host = 'localhost';
	$db_prefix = 'dbc_';
	$title = 'Delux Board Conversations forum';
	$description = 'Welcome to Delux Board Conversations forum';
	$default_lang = 'Russian';
	$default_style = 'Default';
}
else
{
	$db_type = $_POST['req_db_type'];
	$db_host = DBC_trim($_POST['req_db_host']);
	$db_name = DBC_trim($_POST['req_db_name']);
	$db_username = DBC_trim($_POST['db_username']);
	$db_password1 = DBC_trim($_POST['db_password1']);
	$db_password2 = DBC_trim($_POST['db_password2']);
	$db_prefix = DBC_trim($_POST['db_prefix']);
	$username = DBC_trim($_POST['req_username']);
	$email = strtolower(DBC_trim($_POST['req_email']));
	$password1 = DBC_trim($_POST['req_password1']);
	$password2 = DBC_trim($_POST['req_password2']);
	$title = DBC_trim($_POST['req_title']);
	$description = DBC_trim($_POST['desc']);
	$base_url = DBC_trim($_POST['req_base_url']);
	$default_lang = DBC_trim($_POST['req_default_lang']);
	$default_style = DBC_trim($_POST['req_default_style']);
	$alerts = array();

	// Make sure base_url doesn't end with a slash
	if (substr($base_url, -1) == '/')
		$base_url = substr($base_url, 0, -1);

	// Validate database password
	if ($db_password1 != $db_password2)
		$alerts[] = 'Пароли базы данных не совпадают.';

	// Validate username and passwords
	if (DBC_strlen($username) < 2)
		$alerts[] = 'Логин должен содержать в себе не мение 2 символа.';
	else if (DBC_strlen($username) > 25) // This usually doesn't happen since the form element only accepts 25 characters
		$alerts[] = 'Usernames must not be more than 25 characters long.';
	else if (!strcasecmp($username, 'Guest'))
		$alerts[] = 'The username guest is reserved.';
	else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username) || preg_match('/((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))/', $username))
		$alerts[] = 'Usernames may not be in the form of an IP address.';
	else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
		$alerts[] = 'Usernames may not contain all the characters \', " and [ or ] at once.';
	else if (preg_match('/(?:\[\/?(?:b|u|i|h|colou?r|quote|code|img|url|email|list)\]|\[(?:code|quote|list)=)/i', $username))
		$alerts[] = 'Usernames may not contain any of the text formatting tags (BBCode) that the forum uses.';

	if (DBC_strlen($password1) < 4)
		$alerts[] = 'Пароль должен быть не короче 4-х символов.';
	else if ($password1 != $password2)
		$alerts[] = 'Пароли не совпадают.';

	// Validate email
	require DBC_ROOT.'engine/email.php';

	if (!is_valid_email($email))
		$alerts[] = 'Адрес электронной почты администратора введен неверно.';

	if ($title == '')
		$alerts[] = 'Вы должны ввести название форума.';

	$default_lang = preg_replace('#[\.\\\/]#', '', $default_lang);
	if (!file_exists(DBC_ROOT.'language/'.$default_lang.'/common.php'))
		$alerts[] = 'The default language chosen doesn\'t seem to exist.';

	$default_style = preg_replace('#[\.\\\/]#', '', $default_style);
	if (!file_exists(DBC_ROOT.'templates/'.$default_style.''))
		$alerts[] = 'The default style chosen doesn\'t seem to exist.';
}

if (!isset($_POST['form_sent']) || !empty($alerts))
{
	// Determine available database extensions
	$dual_mysql = false;
	$db_extensions = array();
	$mysql_innodb = false;
	if (function_exists('mysqli_connect'))
	{
		$db_extensions[] = array('mysql', 'MySQL Standard');
		$db_extensions[] = array('mysql_innodb', 'MySQL Standard (InnoDB)');

		$mysql_innodb = true;
	}
	if (function_exists('mysql_connect'))
	{
		$db_extensions[] = array('mysqli', 'MySQL Improved');
		$db_extensions[] = array('mysqli_innodb', 'MySQL Improved (InnoDB)');
		$mysql_innodb = true;

		if (count($db_extensions) > 2)
			$dual_mysql = true;
	}
	if (function_exists('sqlite_open'))
		$db_extensions[] = array('sqlite', 'SQLite');
	if (function_exists('pg_connect'))
		$db_extensions[] = array('pgsql', 'PostgreSQL');

	if (empty($db_extensions))
		exit('This PHP environment does not have support for any of the databases that Delux Board Conversations supports. PHP needs to have support for either MySQL, PostgreSQL or SQLite in order for Delux Board Conversations to be installed.');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="templates/Default/css/style.css" />
<script type="text/javascript" src="engine/classes/js/jquery.js"></script>
<script type="text/javascript" src="engine/classes/js/jqueryui.js"></script>
<script type="text/javascript" src="engine/classes/js/dbc_js.js"></script>
<title>Установка Delux Board Conversations</title>
<script type="text/javascript">
function process_form(the_form)
{
	var element_names = new Object()
	element_names["req_db_type"] = "Тип базы данных"
	element_names["req_db_host"] = "Database server hostname"
	element_names["req_db_name"] = "Имя базы данных"
	element_names["db_prefix"] = "Префикс таблиц"
	element_names["req_username"] = "Имя администратора"
	element_names["req_password1"] = "Пароль администратора"
	element_names["req_password2"] = "Подтверждение пароля"
	element_names["req_email"] = "Email администратора"
	element_names["req_title"] = "Титл форума"
	element_names["req_base_url"] = "Base URL"

	if (document.all || document.getElementById)
	{
		for (var i = 0; i < the_form.length; ++i)
		{
			var elem = the_form.elements[i]
			if (elem.name && elem.name.substring(0, 4) == "req_")
			{
				if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" || elem.type=="file") && elem.value=='')
				{
					alert("\"" + element_names[elem.name] + "\" обязательное поле в этой форме.")
					elem.focus()
					return false
				}
			}
		}
	}

	return true
}
</script>
</head>
<body onload="document.getElementById('install').req_db_type.focus();document.getElementById('install').start.disabled=false;">
<div id="DBC{DBC_page}" class="DBC">


<table width="100%" height="26" border="0" cellpadding="0" cellspacing="0"><tr>
<td align="left" width="50">
			<div class="topbtn">
				<span>
					<a class="tbvk" href="#"><img src="engine/skins/images/spacer.gif" title="Vkontakte" alt="Vkontakte" /></a>
					<a class="tbfb" href="#"><img src="engine/skins/images/spacer.gif" title="facebook" alt="facebook" /></a>
					<a class="tbwm" href="#"><img src="engine/skins/images/spacer.gif" title="Web Money WMID" alt="Web Money WMID" /></a>
				</span>
			</div>
</td>
<td align="right" width="50%"><span class="DBC_Welcome">Welcome to DBC forum</span></td>
</tr></table>

<table width="100%" height="119" border="0" cellpadding="0" cellspacing="0"><tr>
<td align="left" width="11" class="header_left"></td>
<td align="left" class="header_center">

	<table width="100%" height="119" border="0" cellpadding="0" cellspacing="0" ><tr>
	<td align="left" width="50%"><div class="logo"></div></td>
	<td valign="top" align="right" width="50%">
	
		<table width="100%" height="119" border="0" cellpadding="0" cellspacing="0"><tr>
		<td valign="top" align="right" width="215" height="89">
		
		<table border="0" class="last_top" style="width: 225px;height: 40px;" cellpadding="0" cellspacing="0"><tr>
		<td valign="top" align="center" width="35" height="35"><img src="templates/Default/images/login_info.png" class="last_icon" border="0" alt=""/></td>
		<td valign="top" align="left"><div class="last_name">Добро пожаловать!</div><div class="last_visit"><i>Delux Board Conversations</i></div></td>
		</tr></table>
		
		</td></tr>
		
		<tr><td valign="bottom" align="right" height="21">

		<table style="width: 500px;" height="21" border="0" cellpadding="0" cellspacing="0"><tr>
		<td align="left" class="dbc_title_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
		<td align="right" class="dbc_title_center"><span class="dbc_title">Delux Board Conversations forum</span></td>
		<td align="left" width="4" class="dbc_title_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
		</tr></table>
		
		</td></tr></table>
	
	</td></td></tr></table>

</td><td align="left" width="11" class="header_right"></td></tr></table>
<div id="info_dbc" title="Информация о Delux Board Conversations (DBC)" style="display: none;">
<div style="width: auto; min-height: 111px; height: auto;overflow: auto;">
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
<td align="left" valign="top" width="100"><img src="engine/skins/images/dbc.jpg" alt="" width="100"/></td>
<td align="left" valign="top"><span class="DBC_title_p">Delux Board Conversations 1.0.0</span><br/>
Название скрипта: <b>Delux Board Conversations</b> (сокращенно <b>DBC</b>).<br>
<b>Delux Board Conversations</b> - программное обеспечение, необходимое любому онлайн сообществу для создания своего интернет-форума...<br><br>
<b>Delux Board Conversations</b> - простой и в тоже время мощный движок форума. Все функции форума имеют гибкую систему конфигурации, что позволяет настроить 
форум под ваши требования, под требования вашего проекта. Благодаря системе шаблонов форум легко изменить до неузнаваемости, почти 
каждый элемент форума имеет свой шаблон, что позволяет вам гибко настраивать вывод какой-либо информации.
 Несмотря на количество функций, используется минимальное количество ресурсов вашего сервера.</span><br><br><br>
<div class="copyright" align="right"><span id="copyright">2011 © Под управлением Delux Board Conversations</span>
</div></td>
</tr></table>
</div>
</div>
<script type="text/javascript">
function showAddNews_R() {
$(function(){
	$('#info_dbc').dialog({
		autoOpen: true,
		show: 'slide',
		hide: 'fade',
		width: 680,
		height: 280,
		buttons: {
		"Закрыть" : function() {
		$(this).dialog("close");
            }
               }
	});
});
}
</script>
<table width="100%" height="42" border="0" cellpadding="0" cellspacing="0"><tr>
<td align="left" width="6" class="topmenu_left"></td>
<td align="left" class="topmenu_center"><div class="topmenu_text">


<div class="bottmenu"><ul class="ttopmenu">
<li id="navextra1"><a href="install.php">Установка</a></li>
<li id="navlogin"><a href="#" class="last_item"></a></li>
</ul></div>


</div></td>
<td align="right" class="topmenu_center"><input class="bbcodes" value="?" onclick="showAddNews_R();" type="button"></td>
<td align="left" width="6" class="topmenu_right"></td>
</tr></table>


<div class="DBCwrap">


<div id="brdmain">
	<div class="box">
		<form id="install" method="post" action="install.php" onsubmit="this.start.disabled=true;if(process_form(this)){return true;}else{this.start.disabled=false;return false;}">
		<div><input type="hidden" name="form_sent" value="1" /></div>

<div class="inform">
<?php if (!empty($alerts)): ?>
	<div class="forminfo error-info">
		<h3>Следующие ошибки должны быть исправлены:</h3>
			<ul class="error-list">
<?php
foreach ($alerts as $cur_alert)
	echo "\t\t\t\t\t\t".'<li><strong>'.$cur_alert.'</strong></li>'."\n";
?>
					</ul>
	</div>
<?php endif; ?>
</div>
<br/>
<table width="100%" height="38" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="28" class="bg_forum_title_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_title_center"><span class="cat_title">Настройка скрипта перед установкой</span></td>
<td align="center" width="28" class="bg_forum_title_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></table>



<table class="forum_adv_table"  width="100%" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" class="forum_adv_tleft" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" width="100%"><div class="forum_adv"><br/>

			<div id="chmod" class="inform" action="">
					<div class="login_info">Выполните пожалуйста данные действия</div>
					<div class="infldset">
						<p><strong>Выставите пожалуйста права chmod</strong></p>
			<table cellpadding="0" border="0" style="width: 100%" class="cClass">
			<tr><td align="left" style="width: 310px">
			<table cellpadding="0" border="0" style="width: 300px">
			<tr><td width="150" align="left">engine/cache/</td><td width="150" align="right"><b>777</b></td></tr>
			<tr><td width="150" align="left">engine/data/</td><td width="150" align="right"><b>777</b></td></tr>
			<tr><td width="150" align="left">uploads/</td><td width="150" align="right"><b>777</b></td></tr>
			<tr><td width="150" align="left">uploads/fotos/</td><td width="150" align="right"><b>777</b></td></tr>
			<tr><td width="150" align="left">uploads/files/</td><td width="150" align="right"><b>777</b></td></tr>
			</table>
			</td><td align="left" valign="top">
			<p><b>Внимание!</b></p>
			<p>Форум Delux Board Conversations работает в кодировке utf-8</p>
			<p>В случае возникновения каких-либо проблем во время установки или эксплуатации форума просьба сообщить о них на 
			<a href="http://dbc-forum.com//support/">официальный форум поддержки Delux Board Conversations</a></p>
			</td>
			</tr></table>

					</div>
			</div>
<br/>
</div></td>
<td align="left" class="forum_adv_tright" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
</td></tr></table>
<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="30" class="bg_forum_bott_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_bott_center"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="center" width="30" class="bg_forum_bott_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></thead></table>








<table width="100%" height="38" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="28" class="bg_forum_title_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_title_center"><span class="cat_title">Настройка базы данных</span></td>
<td align="center" width="28" class="bg_forum_title_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></table>



<table class="forum_adv_table"  width="100%" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" class="forum_adv_tleft" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" width="100%"><div class="forum_adv2"><br/><div style="padding: 0px 25px 0px 25px;">

	<table class="tableform">
	<tbody><tr class="fieldtr">
		<td class="label">Тип базы данных:</td>
		<td>
<select name="req_db_type">
<?php

	foreach ($db_extensions as $temp)
	{
		if ($temp[0] == $db_type)
			echo "\t\t\t\t\t\t\t".'<option value="'.$temp[0].'" selected="selected">'.$temp[1].'</option>'."\n";
		else
			echo "\t\t\t\t\t\t\t".'<option value="'.$temp[0].'">'.$temp[1].'</option>'."\n";
	}

?>
						</select>
			<br/>
			<span class="small">
			Укажите пожалуйста тип вашей базы данных.
			</span>
</td>
	</tr>
	<tr class="fieldtr">

		<td class="label">Имя хоста:</td>
		<td><input name="req_db_host" value="<?php echo DBC_htmlspecialchars($db_host) ?>" class="f_input" type="text"><br/>
			<span class="small">
			Адрес сервера базы данных (например: localhost, db.myhost.com или 192.168.0.15). Вы можете указать нестандартный номер порта, если база данных не работает на порту по 
			умолчанию (например: localhost: 3580). Для поддержки SQLite, просто введите что-нибудь или оставить его на "localhost"..
			</span>
	</td>
	</tr>
	<tr class="fieldtr">

		<td class="label">Имя базы данных (Mysql):</td>
		<td><input id="req_db_name" name="req_db_name" value="<?php echo DBC_htmlspecialchars($db_name) ?>" class="f_input" type="text">
			<br/>
			<span class="small">
			Здесь введите название базы данных.
			</span>
	</td>
	</tr>
	<tr class="fieldtr">
		<td class="label">Имя пользователя базы данных:</td>
		<td><input name="db_username" value="<?php echo DBC_htmlspecialchars($db_username) ?>" class="f_input" type="text">
			<br/>
			<span class="small">
			Здесь введите имя пользователя базы данных.
			</span>
		</td>
	</tr>
	<tr class="fieldtr">
		<td class="label">Пароль от базы данных:</td>
		<td><input name="db_password1" class="f_input" type="password">
			<br/>
			<span class="small">
			Здесь введите пароль базы данных.
			</span>
	</td>

	</tr>
	<tr class="fieldtr">
		<td class="label">Повторите пароль:</td>
		<td><input name="db_password2" class="f_input" type="password">
			<br/>
			<span class="small">
			Повторите пароль базы данных.
			</span>
	</td>
	</tr>
	<tr class="fieldtr">
		<td class="label">Префикс таблиц:</td>
		<td><input name="db_prefix" class="f_input" type="text" value="<?php echo DBC_htmlspecialchars($db_prefix) ?>">

			<br/>
			<span class="small">
			Вы можете указать префикс таблиц. Таким образом, вы можете запустить несколько копий Delux Board Conversations в одной базе данных (например: dbc_).
			</span>
		</td>

	</tr>
	</tbody></table>

</div>
<br/>
</div></td>
<td align="left" class="forum_adv_tright" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
</td></tr></table>
<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="30" class="bg_forum_bott_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_bott_center"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="center" width="30" class="bg_forum_bott_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></thead></table>



<table width="100%" height="38" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="28" class="bg_forum_title_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_title_center"><span class="cat_title">Учетная запись администратора</span></td>
<td align="center" width="28" class="bg_forum_title_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></table>



<table class="forum_adv_table"  width="100%" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" class="forum_adv_tleft" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" width="100%"><div class="forum_adv2"><br/><div style="padding: 0px 25px 0px 25px;">



	<table class="tableform">
	<tbody><tr class="fieldtr">
		<td class="label">Введите логин Администратора:</td>
		<td><input name="req_username" value="<?php echo DBC_htmlspecialchars($username) ?>" class="f_input" type="text">
			<br/>
			<span class="small">
			Здесь введите имя администратора.
			</span>
	</td>
	</tr>
	<tr class="fieldtr">

		<td class="label">Пароль:</td>
		<td><input id="req_password1"" name="req_password1" class="f_input" type="password">
	</td>
	</tr>
	<tr class="fieldtr">

		<td class="label">Подтвердите пароль:</td>
		<td><input id="req_password1"" name="req_password2" class="f_input" type="password">
	</td>
	</tr>
	<tr class="fieldtr">
		<td class="label">Email Администратора:</td>
		<td><input id="req_email" name="req_email" value="<?php echo DBC_htmlspecialchars($email) ?>" class="f_input" type="text">
			<br/>
			<span class="small">
			Адрес электронной почты администратора форума.
			</span>
		</td>
	</tr>
	</tbody></table>

			</div>
			<br/>
			</div></td>
			<td align="left" class="forum_adv_tright" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
			</td></tr></table>
			<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0"><thead><tr>
			<td align="left" width="30" class="bg_forum_bott_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
			<td align="left" class="bg_forum_bott_center"><img src="engine/skins/images/spacer.gif" border="0"></td>
			<td align="center" width="30" class="bg_forum_bott_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
			</tr></thead></table>



			<table width="100%" height="38" border="0" cellpadding="0" cellspacing="0"><thead><tr>
			<td align="left" width="28" class="bg_forum_title_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
			<td align="left" class="bg_forum_title_center"><span class="cat_title">Настройка Форума</span></td>
			<td align="center" width="28" class="bg_forum_title_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
			</tr></table>
			
			
			
			<table class="forum_adv_table"  width="100%" border="0" cellpadding="0" cellspacing="0"><thead><tr>
			<td align="left" class="forum_adv_tleft" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
			<td align="left" width="100%"><div class="forum_adv2"><br/><div style="padding: 0px 25px 0px 25px;">









	<table class="tableform">
	<tbody><tr class="fieldtr">
		<td class="label">Титл форума:</td>
		<td><input id="req_title" name="req_title" value="<?php echo DBC_htmlspecialchars($title) ?>" class="f_input" type="text">
			<br/>
			<span class="small">
			Название вашего форума (в верхней части каждой страницы).
			</span>
	</td>
	</tr>
	<tr class="fieldtr">

		<td class="label">Описание форума:</td>
		<td><input id="desc" name="desc" value="<?php echo DBC_htmlspecialchars($description) ?>" class="f_input" type="text">
			<br/>
			<span class="small">
			Краткое описание этого форума (в верхней части каждой страницы). Это поле может содержать HTML код.
			</span>
	</td>
	</tr>
	<tr class="fieldtr">

		<td class="label">Base URL:</td>
		<td><input id="req_base_url" name="req_base_url" value="<?php echo DBC_htmlspecialchars($base_url) ?>" class="f_input" type="text">
			<br/>
			<span class="small">
			Введите правильный URL адрес вашего форума.Если URL адрес будет указан не верно,работа форума будет не корректна.
			</span>
	</td>
	</tr>
	<tr class="fieldtr">
		<td class="label">Язык по умолчанию:</td>
		<td><select id="req_default_lang" name="req_default_lang">
<?php

		$languages = forum_list_langs();

		foreach ($languages as $temp)
		{
			if ($temp == $default_lang)
				echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
			else
				echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
		}

?>
						</select>
			<br/>
			<span class="small">
			Язык по умолчанию используется для гостей и пользователей. Каждому пользователю продоставляется выбор "Языка по умолчанию" в собственном профиле.
			</span>
		</td>
	</tr>
	<tr class="fieldtr">

		<td class="label">Стиль по умолчанию:</td>
		<td><select id="req_default_style" name="req_default_style">
<?php

		$styles = forum_list_styles();

		foreach ($styles as $temp)
		{
			if ($temp == $default_style)
				echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'."\n";
			else
				echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'."\n";
		}

?>
						</select>
			<br/>
			<span class="small">
			Стиль по умолчанию используется для гостей и пользователей. Каждому пользователю продоставляется выбор "Стиля по умолчанию" в собственном профиле.
			</span>
	</td>
	</tr>
	<tr class="fieldtr flast">
		<td colspan="2" align="center">
			<input class="fbutton" type="submit" name="start" value="Установить" />
		</td>
	</tr>
	</tbody></table>
		</form>
</div>
<br/>
</div></td>
<td align="left" class="forum_adv_tright" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
</td></tr></table>
<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="30" class="bg_forum_bott_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_bott_center"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="center" width="30" class="bg_forum_bott_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></thead></table>
	</div>
</div>
</div>


<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0"><tr>
<td align="left" width="12" class="botmenu_left"></td>
<td align="center" height="30" class="botmenu_center">

		<ul class="bottmenu">
		<li><a title="Установка" href="install.php">Установка</a></li>
		<li><a title="" href="#" class="last_item"></a></li>
		</ul>

</td>
<td align="left" width="12" class="botmenu_right"></td>
</tr></table>


<table width="100%" height="24" border="0" cellpadding="0" cellspacing="0"><tr>
<td align="left" width="12" class="footer_left"></td>
<td align="left" class="footer_center">
	<table width="100%" height="24" border="0" cellpadding="0" cellspacing="0"><tr>
	<td width="60%" align="left"><p id="debugtime">Установка форума Delux Board Conversations forum</p></td>
	<td width="40%" align="right"><span id="copyright">2011 © Под управлением Delux Board Conversations</span></td>
	</tr></table>
</td>
<td align="left" width="12" class="footer_right"></td>
</tr>
</table>
<div class="delux_art"><a href="http://delux-art.ru/" target="_blank">Designed by DELUX-Art</a></div>

</div>

</body>
</html>
<?php

}
else
{
	// Load the appropriate DB layer class
	switch ($db_type)
	{
		case 'mysql':
			require DBC_ROOT.'engine/data/dblayer/mysql.php';
			break;

		case 'mysql_innodb':
			require DBC_ROOT.'engine/data/dblayer/mysql_innodb.php';
			break;

		case 'mysqli':
			require DBC_ROOT.'engine/data/dblayer/mysqli.php';
			break;

		case 'mysqli_innodb':
			require DBC_ROOT.'engine/data/dblayer/mysqli_innodb.php';
			break;

		case 'pgsql':
			require DBC_ROOT.'engine/data/dblayer/pgsql.php';
			break;

		case 'sqlite':
			require DBC_ROOT.'engine/data/dblayer/sqlite.php';
			break;

		default:
			error('\''.DBC_htmlspecialchars($db_type).'\' is not a valid database type');
	}

	// Create the database object (and connect/select db)
	$db = new DBLayer($db_host, $db_username, $db_password1, $db_name, $db_prefix, false);

	// Validate prefix
	if (strlen($db_prefix) > 0 && (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $db_prefix) || strlen($db_prefix) > 40))
		error('The table prefix \''.$db->prefix.'\' contains illegal characters or is too long. The prefix may contain the letters a to z, any numbers and the underscore character. They must however not start with a number. The maximum length is 40 characters. Please choose a different prefix');

	// Do some DB type specific checks
	switch ($db_type)
	{
		case 'mysql':
		case 'mysqli':
		case 'mysql_innodb':
		case 'mysqli_innodb':
			$mysql_info = $db->get_version();
			if (version_compare($mysql_info['version'], MIN_MYSQL_VERSION, '<'))
				error('You are running MySQL version '.$mysql_version.'. Delux Board Conversations '.FORUM_VERSION.' requires at least MySQL '.MIN_MYSQL_VERSION.' to run properly. You must upgrade your MySQL installation before you can continue');
			break;

		case 'pgsql':
			$pgsql_info = $db->get_version();
			if (version_compare($pgsql_info['version'], MIN_PGSQL_VERSION, '<'))
				error('You are running PostgreSQL version '.$pgsql_info.'. Delux Board Conversations '.FORUM_VERSION.' requires at least PostgreSQL '.MIN_PGSQL_VERSION.' to run properly. You must upgrade your PostgreSQL installation before you can continue');
			break;

		case 'sqlite':
			if (strtolower($db_prefix) == 'sqlite_')
				error('The table prefix \'sqlite_\' is reserved for use by the SQLite engine. Please choose a different prefix');
			break;
	}


	// Make sure Delux Board Conversations isn't already installed
	$result = $db->query('SELECT 1 FROM '.$db_prefix.'users WHERE id=1');
	if ($db->num_rows($result))
		error('A table called "'.$db_prefix.'users" is already present in the database "'.$db_name.'". This could mean that Delux Board Conversations is already installed or that another piece of software is installed and is occupying one or more of the table names Delux Board Conversations requires. If you want to install multiple copies of Delux Board Conversations in the same database, you must choose a different table prefix');

	// Check if InnoDB is available
	if ($db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
	{
		$result = $db->query('SHOW VARIABLES LIKE \'have_innodb\'');
		list (, $result) = $db->fetch_row($result);
		if ((strtoupper($result) != 'YES'))
			error('InnoDB does not seem to be enabled. Please choose a database layer that does not have InnoDB support, or enable InnoDB on your MySQL server');
	}


	// Start a transaction
	$db->start_transaction();


	// Create all tables
	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'username'		=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> true
			),
			'ip'			=> array(
				'datatype'		=> 'VARCHAR(255)',
				'allow_null'	=> true
			),
			'email'			=> array(
				'datatype'		=> 'VARCHAR(80)',
				'allow_null'	=> true
			),
			'message'		=> array(
				'datatype'		=> 'VARCHAR(255)',
				'allow_null'	=> true
			),
			'expire'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'ban_creator'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			)
		),
		'PRIMARY KEY'	=> array('id'),
		'INDEXES'		=> array(
			'username_idx'	=> array('username')
		)
	);

	if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
		$schema['INDEXES']['username_idx'] = array('username(25)');

	$db->create_table('bans', $schema) or error('Unable to create bans table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'cat_name'		=> array(
				'datatype'		=> 'VARCHAR(80)',
				'allow_null'	=> false,
				'default'		=> '\'New Category\''
			),
			'disp_position'	=> array(
				'datatype'		=> 'INT(10)',
				'allow_null'	=> false,
				'default'		=> '0'
			)
		),
		'PRIMARY KEY'	=> array('id')
	);

	$db->create_table('categories', $schema) or error('Unable to create categories table', __FILE__, __LINE__, $db->error());

	$schema = array(
		'FIELDS'		=> array(
				'id'				=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false,
			),
			'title'		=> array(
				'datatype'		=> 'VARCHAR(75)',
				'allow_null'		=> false,
				'default'		=> '\'\''
			),
			'content'				=> array(
				'datatype'		=> 'TEXT',
				'allow_null'		=> false,
				'default'		=> '\'\''
			)
		),
		'PRIMARY KEY'	=> array('id')
	);

	$db->create_table('pages', $schema) or error('Unable to create categories table', __FILE__, __LINE__, $db->error());

	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'search_for'	=> array(
				'datatype'		=> 'VARCHAR(60)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'replace_with'	=> array(
				'datatype'		=> 'VARCHAR(60)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			)
		),
		'PRIMARY KEY'	=> array('id')
	);

	$db->create_table('censoring', $schema) or error('Unable to create censoring table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'conf_name'		=> array(
				'datatype'		=> 'VARCHAR(255)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'conf_value'	=> array(
				'datatype'		=> 'TEXT',
				'allow_null'	=> true
			)
		),
		'PRIMARY KEY'	=> array('conf_name')
	);

	$db->create_table('config', $schema) or error('Unable to create config table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'group_id'		=> array(
				'datatype'		=> 'INT(10)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'forum_id'		=> array(
				'datatype'		=> 'INT(10)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'read_forum'	=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'post_replies'	=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'post_topics'	=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			)
		),
		'PRIMARY KEY'	=> array('group_id', 'forum_id')
	);

	$db->create_table('forum_perms', $schema) or error('Unable to create forum_perms table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'forum_name'	=> array(
				'datatype'		=> 'VARCHAR(80)',
				'allow_null'	=> false,
				'default'		=> '\'New forum\''
			),
			'forum_desc'	=> array(
				'datatype'		=> 'TEXT',
				'allow_null'	=> true
			),
			'redirect_url'	=> array(
				'datatype'		=> 'VARCHAR(100)',
				'allow_null'	=> true
			),
			'moderators'	=> array(
				'datatype'		=> 'TEXT',
				'allow_null'	=> true
			),
			'num_topics'	=> array(
				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'num_posts'		=> array(
				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'last_post'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'last_post_id'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'last_poster'	=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> true
			),
			'last_poster_id'	=> array(
				'datatype'		=> 'INT(10)',
				'allow_null'	=> true
			),
			'sort_by'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'disp_position'	=> array(
				'datatype'		=> 'INT(10)',
				'allow_null'	=> false,
				'default'		=>	'0'
			),
			'cat_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=>	'0'
			),
			'no_sum_mess'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
		),
		'PRIMARY KEY'	=> array('id')
	);

	$db->create_table('forums', $schema) or error('Unable to create forums table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'g_id'						=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'g_title'					=> array(
				'datatype'		=> 'VARCHAR(50)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'g_color'			=> array(
				'datatype'		=> 'VARCHAR(7)',
				'allow_null'	=> true,
				'default'		=> '\'\''
			),
			'g_user_title'				=> array(
				'datatype'		=> 'VARCHAR(50)',
				'allow_null'	=> true
			),
			'g_moderator'				=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'g_mod_edit_users'			=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'g_mod_rename_users'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'g_mod_change_passwords'	=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'g_mod_ban_users'			=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'g_read_board'				=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_view_users'				=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_post_replies'			=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_post_topics'				=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_edit_posts'				=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_delete_posts'			=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_delete_topics'			=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_set_title'				=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_search'					=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_search_users'			=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_send_email'				=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_post_flood'				=> array(
				'datatype'		=> 'SMALLINT(6)',
				'allow_null'	=> false,
				'default'		=> '30'
			),
			'g_search_flood'			=> array(
				'datatype'		=> 'SMALLINT(6)',
				'allow_null'	=> false,
				'default'		=> '30'
			),
			'g_email_flood'				=> array(
				'datatype'		=> 'SMALLINT(6)',
				'allow_null'	=> false,
				'default'		=> '60'
			),
			'g_deledit_interval'				=> array(   // мод ограничения времени - Visman
				'datatype'		=> 'INT(10)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'g_pm'				=> array(   // New PMS - Visman
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'g_pm_limit'				=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '100'
			),
			'g_rep_minus_min'			=> array(
				'datatype'		=> 'INT(10)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'g_rep_plus_min'			=> array(
				'datatype'		=> 'INT(10)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'g_rep_enable'			=> array(
				'datatype'		=> 'SMALLINT(6)',
				'allow_null'	=> false,
				'default'		=> '1'
			)
		),
		'PRIMARY KEY'	=> array('g_id')
	);

	$db->create_table('groups', $schema) or error('Unable to create groups table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'user_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'ident'			=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'logged'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'idle'			=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'last_post'			=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'last_search'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'witt_data'			=> array(
				'datatype'		=> 'VARCHAR(255)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
		),
		'UNIQUE KEYS'	=> array(
			'user_id_ident_idx'	=> array('user_id', 'ident')
		),
		'INDEXES'		=> array(
			'ident_idx'		=> array('ident'),
			'logged_idx'	=> array('logged')
		),
		'ENGINE'		=> 'HEAP'
	);

	if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
	{
		$schema['UNIQUE KEYS']['user_id_ident_idx'] = array('user_id', 'ident(25)');
		$schema['INDEXES']['ident_idx'] = array('ident(25)');
	}

	if ($db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
		$schema['ENGINE'] = 'InnoDB';

	$db->create_table('online', $schema) or error('Unable to create online table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'poster'		=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'poster_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'poster_ip'		=> array(
				'datatype'		=> 'VARCHAR(39)',
				'allow_null'	=> true
			),
			'poster_email'	=> array(
				'datatype'		=> 'VARCHAR(80)',
				'allow_null'	=> true
			),
			'message'		=> array(
				'datatype'		=> 'MEDIUMTEXT',
				'allow_null'	=> true
			),
			'hide_smilies'	=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'edit_post'	=> array(                    // мод ограничения времени - Visman
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'posted'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'edited'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'edited_by'		=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> true
			),
			'user_agent'		=> array(
				'datatype'		=> 'VARCHAR(255)',      // MOD user agent - Visman
				'allow_null'	=> true
			),
			'topic_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			)
		),
		'PRIMARY KEY'	=> array('id'),
		'INDEXES'		=> array(
			'topic_id_idx'	=> array('topic_id'),
			'multi_idx'		=> array('poster_id', 'topic_id')
		)
	);

	$db->create_table('posts', $schema) or error('Unable to create posts table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'rank'			=> array(
				'datatype'		=> 'VARCHAR(50)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'min_posts'		=> array(
				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			)
		),
		'PRIMARY KEY'	=> array('id')
	);

	$db->create_table('ranks', $schema) or error('Unable to create ranks table', __FILE__, __LINE__, $db->error());

	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'post_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'topic_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'forum_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'reported_by'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'created'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'message'		=> array(
				'datatype'		=> 'TEXT',
				'allow_null'	=> true
			),
			'zapped'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'zapped_by'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			)
		),
		'PRIMARY KEY'	=> array('id'),
		'INDEXES'		=> array(
			'zapped_idx'	=> array('zapped')
		)
	);

	$db->create_table('reports', $schema) or error('Unable to create reports table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'ident'			=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'search_data'	=> array(
				'datatype'		=> 'MEDIUMTEXT',
				'allow_null'	=> true
			)
		),
		'PRIMARY KEY'	=> array('id'),
		'INDEXES'		=> array(
			'ident_idx'	=> array('ident')
		)
	);

	if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
		$schema['INDEXES']['ident_idx'] = array('ident(8)');

	$db->create_table('search_cache', $schema) or error('Unable to create search_cache table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'post_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'word_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'subject_match'	=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			)
		),
		'INDEXES'		=> array(
			'word_id_idx'	=> array('word_id'),
			'post_id_idx'	=> array('post_id')
		)
	);

	$db->create_table('search_matches', $schema) or error('Unable to create search_matches table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'word'			=> array(
				'datatype'		=> 'VARCHAR(20)',
				'allow_null'	=> false,
				'default'		=> '\'\'',
				'collation'		=> 'bin'
			)
		),
		'PRIMARY KEY'	=> array('word'),
		'INDEXES'		=> array(
			'id_idx'	=> array('id')
		)
	);

	if ($db_type == 'sqlite')
	{
		$schema['PRIMARY KEY'] = array('id');
		$schema['UNIQUE KEYS'] = array('word_idx'	=> array('word'));
	}

	$db->create_table('search_words', $schema) or error('Unable to create search_words table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'user_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'topic_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			)
		),
		'PRIMARY KEY'	=> array('user_id', 'topic_id')
	);

	$db->create_table('subscriptions', $schema) or error('Unable to create subscriptions table', __FILE__, __LINE__, $db->error());


	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'poster'		=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'subject'		=> array(
				'datatype'		=> 'VARCHAR(255)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'topic_desc'		=> array(
				'datatype'		=> 'TEXT',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'posted'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'first_post_id'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'last_post'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'last_post_id'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'last_poster'	=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> true
			),
			'last_poster_id'	=> array(
				'datatype'		=> 'INT(10)',
				'allow_null'	=> true
			),
			'num_views'		=> array(
				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'num_replies'	=> array(
				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'closed'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'sticky'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'stick_fp'		=> array(                     // StickFP - Visman
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'moved_to'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'forum_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			)
		),
		'PRIMARY KEY'	=> array('id'),
		'INDEXES'		=> array(
			'forum_id_idx'		=> array('forum_id'),
			'moved_to_idx'		=> array('moved_to'),
			'last_post_idx'		=> array('last_post'),
			'first_post_id_idx'	=> array('first_post_id')
		)
	);

	$db->create_table('topics', $schema) or error('Unable to create topics table', __FILE__, __LINE__, $db->error());

	// автоблокировка IP - Visman
	$schema = array(
		'FIELDS'		=> array(
			'block_ip'			=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'block_log'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'block_type'			=> array(
				'datatype'		=> 'SMALLINT(6)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
		),
		'INDEXES'		=> array(
			'block_ip_idx'		=> array('block_ip'),
			'block_type_idx'	=> array('block_type')
		),
		'ENGINE'		=> 'HEAP'
	);

	$db->create_table('blocking', $schema) or error('Unable to create blocking table', __FILE__, __LINE__, $db->error());

	// New PMS - Visman
	$schema = array(
		'FIELDS'		=> array(
			'bl_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'bl_user_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'bl_user'		=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
		),
		'INDEXES'		=> array(
			'bl_id_idx'	=> array('bl_id'),
			'bl_user_id_idx'	=> array('bl_user_id')
		)
	);

	$db->create_table('pms_new_block', $schema) or error('Unable to create pms_new_block table', __FILE__, __LINE__, $db->error());

	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'poster'		=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'poster_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'poster_ip'		=> array(
				'datatype'		=> 'VARCHAR(39)',
				'allow_null'	=> true
			),
			'message'		=> array(
				'datatype'		=> 'TEXT',
				'allow_null'	=> true,
				'default'		=> '\'\''
			),
			'hide_smilies'	=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'posted'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'edited'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'edited_by'		=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> true
			),
			'post_seen'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'post_new'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'topic_id'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			)
		),
		'PRIMARY KEY'	=> array('id'),
		'INDEXES'		=> array(
			'topic_id_idx'	=> array('topic_id'),
			'multi_idx'		=> array('poster_id', 'topic_id')
		)
	);

	$db->create_table('pms_new_posts', $schema) or error('Unable to create pms_new_posts table', __FILE__, __LINE__, $db->error());

	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'topic'		=> array(
				'datatype'		=> 'VARCHAR(255)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'starter'		=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'starter_id'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'to_user'		=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'to_id'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'replies'	=> array(
				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'last_posted'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'last_poster'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'see_st'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'see_to'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'topic_st'		=> array(
				'datatype'		=> 'TINYINT(4)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'topic_to'		=> array(
				'datatype'		=> 'TINYINT(4)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
		),
		'PRIMARY KEY'	=> array('id'),
		'INDEXES'		=> array(
			'multi_idx_st'		=> array('starter_id', 'topic_st'),
			'multi_idx_to'		=> array('to_id', 'topic_to')
		)
	);

	$db->create_table('pms_new_topics', $schema) or error('Unable to create pms_new_topics table', __FILE__, __LINE__, $db->error());
	// New PMS

	$schema = array(
		'FIELDS'		=> array(
			'id'				=> array(
				'datatype'		=> 'SERIAL',
				'allow_null'	=> false
			),
			'group_id'			=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '3'
			),
			'username'			=> array(
				'datatype'		=> 'VARCHAR(200)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'password'			=> array(
				'datatype'		=> 'VARCHAR(40)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'email'				=> array(
				'datatype'		=> 'VARCHAR(80)',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'title'				=> array(
				'datatype'		=> 'VARCHAR(50)',
				'allow_null'	=> true
			),
			'realname'			=> array(
				'datatype'		=> 'VARCHAR(40)',
				'allow_null'	=> true
			),
			'url'				=> array(
				'datatype'		=> 'VARCHAR(100)',
				'allow_null'	=> true
			),
			'jabber'			=> array(
				'datatype'		=> 'VARCHAR(80)',
				'allow_null'	=> true
			),
			'icq'				=> array(
				'datatype'		=> 'VARCHAR(12)',
				'allow_null'	=> true
			),
			'Skype'				=> array(
				'datatype'		=> 'VARCHAR(25)',
				'allow_null'	=> true
			),
			'Twitter'				=> array(
				'datatype'		=> 'VARCHAR(100)',
				'allow_null'	=> true
			),
			'vkontakte'				=> array(
				'datatype'		=> 'VARCHAR(100)',
				'allow_null'	=> true
			),
			'msn'				=> array(
				'datatype'		=> 'VARCHAR(80)',
				'allow_null'	=> true
			),
			'title_status'				=> array(
				'datatype'		=> 'VARCHAR(100)',
				'allow_null'	=> true
			),
			'aim'				=> array(
				'datatype'		=> 'VARCHAR(30)',
				'allow_null'	=> true
			),
			'yahoo'				=> array(
				'datatype'		=> 'VARCHAR(30)',
				'allow_null'	=> true
			),
			'location'			=> array(
				'datatype'		=> 'VARCHAR(30)',
				'allow_null'	=> true
			),
			'signature'			=> array(
				'datatype'		=> 'TEXT',
				'allow_null'	=> true
			),
			'disp_topics'		=> array(
				'datatype'		=> 'TINYINT(3) UNSIGNED',
				'allow_null'	=> true
			),
			'disp_posts'		=> array(
				'datatype'		=> 'TINYINT(3) UNSIGNED',
				'allow_null'	=> true
			),
			'email_setting'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'notify_with_post'	=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'auto_notify'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'show_smilies'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'show_img'			=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'show_img_sig'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'show_avatars'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'show_sig'			=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'timezone'			=> array(
				'datatype'		=> 'FLOAT',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'dst'				=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'time_format'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'date_format'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'language'			=> array(
				'datatype'		=> 'VARCHAR(25)',
				'allow_null'	=> false,
				'default'		=> '\'Russian\''
			),
			'style'				=> array(
				'datatype'		=> 'VARCHAR(25)',
				'allow_null'	=> false,
				'default'		=> '\''.$db->escape($default_style).'\''
			),
			'num_posts'			=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'last_post'			=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'last_search'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'last_email_sent'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'registered'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'registration_ip'	=> array(
				'datatype'		=> 'VARCHAR(39)',
				'allow_null'	=> false,
				'default'		=> '\'0.0.0.0\''
			),
			'last_visit'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'admin_note'		=> array(
				'datatype'		=> 'VARCHAR(30)',
				'allow_null'	=> true
			),
			'activate_string'	=> array(
				'datatype'		=> 'VARCHAR(80)',
				'allow_null'	=> true
			),
			'activate_key'		=> array(
				'datatype'		=> 'VARCHAR(8)',
				'allow_null'	=> true
			),
			'messages_enable'		=> array(                 // New PMS
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'messages_email'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'messages_flag'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'messages_new'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'messages_all'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'pmsn_last_post'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> true
			),
			'warning_flag'		=> array(
				'datatype'		=> 'TINYINT(1)',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'warning_all'		=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'gender'			=> array(
				'datatype'		=> 'TINYINT(4) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'rep_minus'		=> array(
				'datatype'		=> 'INT(11) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'rep_plus'		=> array(
				'datatype'		=> 'INT(11) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'reputation_enable'		=> array(
				'datatype'		=> 'SMALLINT(6) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '1'
			),
			'reputation_enable_adm'		=> array(
				'datatype'		=> 'TINYINT(1) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '1'
			)
		),
		'PRIMARY KEY'	=> array('id'),
		'UNIQUE KEYS'	=> array(
			'username_idx'		=> array('username')
		),
		'INDEXES'		=> array(
			'registered_idx'	=> array('registered')
		)
	);

	if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
		$schema['UNIQUE KEYS']['username_idx'] = array('username(25)');

	$db->create_table('users', $schema) or error('Unable to create users table', __FILE__, __LINE__, $db->error());

	// Create "smilies" table - Visman
	$schema = array(
		'FIELDS' => array(
			'id' => array(
				'datatype' => 'SERIAL',
				'allow_null' => false
			),
			'image' => array(
				'datatype' => 'VARCHAR(40)',
				'allow_null' => false,
				'default' => '\'\''
			),
			'text' => array(
				'datatype' => 'VARCHAR(20)',
				'allow_null' => false,
				'default' => '\'\''
			),
			'disp_position' => array(
				'datatype' => 'TINYINT(4) UNSIGNED',
				'allow_null' => false,
				'default' => '0'
			)
		),
		'PRIMARY KEY' => array('id')
	);

	$db->create_table('smilies', $schema) or error('Unable to create smilies table', __FILE__, __LINE__, $db->error());

	$smilies = array(
		':)' => 'smile.png',
		'=)' => 'smile.png',
		':|' => 'neutral.png',
		'=|' => 'neutral.png',
		':(' => 'sad.png',
		'=(' => 'sad.png',
		':D' => 'big_smile.png',
		'=D' => 'big_smile.png',
		':o' => 'yikes.png',
		':O' => 'yikes.png',
		';)' => 'wink.png',
		':/' => 'hmm.png',
		':P' => 'tongue.png',
		':p' => 'tongue.png',
		':lol:' => 'lol.png',
		':mad:' => 'mad.png',
		':rolleyes:' => 'roll.png',
		':cool:' => 'cool.png');

	$i = 0;
	foreach ($smilies as $text => $img)
	{
		$db->query('INSERT INTO '.$db->prefix.'smilies (image, text, disp_position)  VALUES(\''.$img.'\', \''.$db->escape($text).'\', '.$i.')') or error('Unable to add smiley', __FILE__, __LINE__, $db->error());
		$i++;
	}

	$schema = array(
		'FIELDS' => array(
			'id' => array(
				'datatype' => 'SERIAL',
				'allow_null' => false
			),
			'poster' => array(
				'datatype' => 'VARCHAR(200)',
				'allow_null' => false,
				'default' => '\'\''
			),
			'poster_id'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'posted'	=> array(
				'datatype'		=> 'INT(10) UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'message'		=> array(
				'datatype'		=> 'TEXT',
				'allow_null' => false,
				'default' => '\'\''
			)
		),
		'PRIMARY KEY' => array('id')
	);

	$db->create_table('warnings', $schema) or error('Unable to create smilies table', __FILE__, __LINE__, $db->error());

	$schema = array(
		'FIELDS'		=> array(
			'id'			=> array(
				'datatype'		=> 'INT(10)  UNSIGNED',
				'allow_null'	=> false
			),
			'user_id'			=> array(
				'datatype'		=> 'INT(10)  UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'from_user_id'			=> array(
				'datatype'		=> 'INT(10)  UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'time'			=> array(
				'datatype'		=> 'INT(10)  UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'post_id'			=> array(
				'datatype'		=> 'INT(10)  UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'reason'			=> array(
				'datatype'		=> 'TEXT',
				'allow_null'	=> false,
				'default'		=> '\'\''
			),
			'rep_plus'			=> array(
				'datatype'		=> 'TINYINT(1)  UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'rep_minus'			=> array(
				'datatype'		=> 'TINYINT(1)  UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			),
			'topics_id'			=> array(
				'datatype'		=> 'INT(10)  UNSIGNED',
				'allow_null'	=> false,
				'default'		=> '0'
			)
		)
	);

	$db->create_table('reputation', $schema) or error('Unable to create reputation table', __FILE__, __LINE__, $db->error());

	$db->query('ALTER TABLE '.$db->prefix.'reputation ADD INDEX rep_post_id_idx(post_id);') or error('Unable to create INDEX rep_post_id_idx in '.$db->prefix.'reputation.',  __FILE__, __LINE__, $db->error());

	$db->query('ALTER TABLE '.$db->prefix.'reputation ADD INDEX rep_multi_user_id_idx(topics_id, from_user_id);') or 	error('Unable to create INDEX rep_multi_user_id_idx '.$db->prefix.'reputation.',  __FILE__, __LINE__, $db->error());


	$now = time();

	// Insert the four preset groups
	$db->query('INSERT INTO '.$db->prefix.'groups ('.($db_type != 'pgsql' ? 'g_id, ' : '').'g_title, g_color, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood) VALUES('.($db_type != 'pgsql' ? '1, ' : '')."'Администраторы', '#FF0000', 'Администратор', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());

	$db->query('INSERT INTO '.$db->prefix.'groups ('.($db_type != 'pgsql' ? 'g_id, ' : '').'g_title, g_color, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood) VALUES('.($db_type != 'pgsql' ? '2, ' : '')."'Модераторы', '#00AA00', 'Модератор', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());

	$db->query('INSERT INTO '.$db->prefix.'groups ('.($db_type != 'pgsql' ? 'g_id, ' : '').'g_title, g_color, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood) VALUES('.($db_type != 'pgsql' ? '3, ' : '')."'Гости', '#3479a7', NULL, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 60, 30, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());

	$db->query('INSERT INTO '.$db->prefix.'groups ('.($db_type != 'pgsql' ? 'g_id, ' : '').'g_title, g_color, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood) VALUES('.($db_type != 'pgsql' ? '4, ' : '')."'Пользователи', '#3479a7', NULL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 60, 30, 60)") or error('Unable to add group', __FILE__, __LINE__, $db->error());

	// Insert guest and first admin user
	$db->query('INSERT INTO '.$db_prefix."users (group_id, username, password, email) VALUES(3, 'Guest', 'Guest', 'Guest')")
		or error('Unable to add guest user. Please check your configuration and try again', __FILE__, __LINE__, $db->error());

	$db->query('INSERT INTO '.$db_prefix."users (group_id, username, password, email, num_posts, last_post, registered, registration_ip, last_visit) VALUES(1, '".$db->escape($username)."', '".DBC_hash($password1)."', '$email', 1, ".$now.", ".$now.", '127.0.0.1', ".$now.')')
		or error('Unable to add administrator user. Please check your configuration and try again', __FILE__, __LINE__, $db->error());

	$db->query('UPDATE '.$db->prefix.'groups SET g_pm_limit=0 WHERE g_id=1') or error('Unable to merge groups', __FILE__, __LINE__, $db->error());

	// Enable/disable avatars depending on file_uploads setting in PHP configuration
	$avatars = in_array(strtolower(@ini_get('file_uploads')), array('on', 'true', '1')) ? 1 : 0;

	// Insert config data
	$config = array(
		'o_cur_version'							=> "'".FORUM_VERSION."'",
		'o_cur_ver_revision'						=> "'".FORUM_VER_REVISION."'",
		'o_database_revision'						=> "'".FORUM_DB_REVISION."'",
		'o_searchindex_revision'					=> "'".FORUM_SI_REVISION."'",
		'o_parser_revision'						=> "'".FORUM_PARSER_REVISION."'",
		'o_board_title'							=> "'".$db->escape($title)."'",
		'o_board_desc'							=> "'".$db->escape($description)."'",
		'o_default_timezone'						=> "'3'",
		'o_time_format'							=> "'H:i:s'",
		'o_date_format'							=> "'d.m.Y'",
		'o_timeout_visit'							=> "'1800'",
		'o_timeout_online'						=> "'300'",
		'o_redirect_delay'						=> "'1'",
		'o_show_version'							=> "'0'",
		'o_show_user_info'						=> "'1'",
		'o_show_post_count'						=> "'1'",
		'o_signatures'							=> "'1'",
		'o_smilies'								=> "'1'",
		'o_smilies_sig'							=> "'1'",
		'o_make_links'							=> "'1'",
		'o_default_lang'							=> "'".$db->escape($default_lang)."'",
		'o_default_style'							=> "'".$db->escape($default_style)."'",
		'o_default_user_group'						=> "'4'",
		'o_topic_review'							=> "'15'",
		'o_disp_topics_default'					=> "'30'",
		'o_disp_posts_default'						=> "'25'",
		'o_indent_num_spaces'					=> "'4'",
		'o_quote_depth'							=> "'3'",
		'o_quickpost'							=> "'1'",
		'o_users_online'							=> "'1'",
		'o_censoring'							=> "'0'",
		'o_ranks'								=> "'1'",
		'o_show_dot'							=> "'0'",
		'o_topic_views'							=> "'1'",
		'o_quickjump'							=> "'1'",
		'o_gzip'								=> "'0'",
		'o_additional_navlinks'						=> "''",
		'o_additional_links_riend'					=> "'0 = <a href=\"http://dbc-forum.com/support/\">DBC-FORUM Support</a>'",
		'o_report_method'						=> "'0'",
		'o_regs_report'							=> "'0'",
		'o_default_email_setting'					=> "'1'",
		'o_mailing_list'							=> "'".$email."'",
		'o_avatars'								=> "'".$avatars."'",
		'o_avatars_dir'							=> "'uploads/fotos'",
		'o_avatars_width'						=> "'150'",
		'o_avatars_height'						=> "'150'",
		'o_avatars_size'							=> "'102400'",
		'o_search_all_forums'						=> "'1'",
		'o_base_url'							=> "'".$db->escape($base_url)."'",
		'o_vk_link'								=> "'http://vk.com/public_dbc'",
		'o_fb_link'								=> "'http://www.facebook.com/groups/deluxboard'",
		'o_wm_link'							=> "'https://passport.webmoney.ru/asp/certView.asp?wmid=295669148518'",
		'o_admin_email'							=> "'".$email."'",
		'o_webmaster_email'						=> "'".$email."'",
		'o_subscriptions'							=> "'1'",
		'o_smtp_host'							=> "NULL",
		'o_smtp_user'							=> "NULL",
		'o_smtp_pass'							=> "NULL",
		'o_smtp_ssl'							=> "'0'",
		'o_regs_allow'							=> "'1'",
		'o_regs_verify'							=> "'0'",
		'o_announcement'						=> "'0'",
		'o_announcement_message'				=> "'Введите текст вашего объявления'",
		'o_rules'								=> "'0'",
		'o_rules_message'						=> "'Правила Delux Board Conversations.'",
		'o_maintenance'							=> "'0'",
		'o_maintenance_message'					=> "'Форум Delux Board Conversations выключен.<br />\\n<br />\\n/Администрация'",
		'o_default_dst'							=> "'0'",
		'o_feed_type'							=> "'1'",
		'p_message_bbcode'						=> "'1'",
		'p_message_img_tag'						=> "'1'",
		'p_message_all_caps'						=> "'1'",
		'p_subject_all_caps'						=> "'1'",
		'p_sig_all_caps'							=> "'1'",
		'p_sig_bbcode'							=> "'1'",
		'p_sig_img_tag'							=> "'0'",
		'p_sig_length'							=> "'400'",
		'p_sig_lines'							=> "'4'",
		'p_allow_banned_email'					=> "'1'",
		'p_allow_dupe_email'						=> "'0'",
		'p_force_guest_email'						=> "'1'",
		'o_pms_enabled'							=> '1',
		'o_pms_min_kolvo'						=> '0',
		'o_merge_timeout'						=> "'86400'",
		'o_blocking_kolvo'						=> "'3'", 
		'o_blocking_time'						=> "'60'",
		'o_blocking_reglog'						=> "'1'",
		'o_blocking_guest'						=> "'0'",
		'o_blocking_user'						=> "'1'",
		'o_board_redirect'						=> "''",
		'o_board_redirectg' 						=> "'0'",
		'o_coding_forms'							=> "'0'", 
		'o_check_ip'							=> "'0'", 
		'o_reputation_enabled'						=> "'1'", 
		'o_reputation_timeout'						=> "'300'" 
	);

	foreach ($config as $conf_name => $conf_value)
	{
		$db->query('INSERT INTO '.$db_prefix."config (conf_name, conf_value) VALUES('$conf_name', $conf_value)")
			or error('Unable to insert into table '.$db_prefix.'config. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
	}

	// Insert some other default data
	$subject = 'Добро пожаловать';
	$message = 'Поздравляем Вас с успешной установкой форума [b]Delux Board Conversations[/b]!


Внимательно настройте движок под Ваши требования в центре управления.
Если у вас есть вопросы или пожелания, то смело пишите на форуме поддержки.


С уважением,[url=http://dbc-forum.com/][b]Delux Board Conversations[/b][/url]!';

	$db->query('INSERT INTO '.$db_prefix."ranks (rank, min_posts) VALUES('Новичок', 0)")
		or error('Unable to insert into table '.$db_prefix.'ranks. Please check your configuration and try again', __FILE__, __LINE__, $db->error());

	$db->query('INSERT INTO '.$db_prefix."ranks (rank, min_posts) VALUES('Местный', 10)")
		or error('Unable to insert into table '.$db_prefix.'ranks. Please check your configuration and try again', __FILE__, __LINE__, $db->error());

	$db->query('INSERT INTO '.$db_prefix."categories (cat_name, disp_position) VALUES('Тестовая категория', 1)")
		or error('Unable to insert into table '.$db_prefix.'categories. Please check your configuration and try again', __FILE__, __LINE__, $db->error());

	$db->query('INSERT INTO '.$db_prefix."forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, last_poster_id, disp_position, cat_id) VALUES('Тестовый форум', 'Это всего лишь тестовый форум', 1, 1, ".$now.", 1, '".$db->escape($username)."', 2, 1, 1)")
		or error('Unable to insert into table '.$db_prefix.'forums. Please check your configuration and try again', __FILE__, __LINE__, $db->error());

	$db->query('INSERT INTO '.$db_prefix."topics (poster, subject, posted, first_post_id, last_post, last_post_id, last_poster, last_poster_id, forum_id) VALUES('".$db->escape($username)."', '".$db->escape($subject)."', ".$now.", 1, ".$now.", 1, '".$db->escape($username)."', 2, 1)")
		or error('Unable to insert into table '.$db_prefix.'topics. Please check your configuration and try again', __FILE__, __LINE__, $db->error());

	$db->query('INSERT INTO '.$db_prefix."posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES('".$db->escape($username)."', 2, '127.0.0.1', '".$db->escape($message)."', ".$now.', 1)')
		or error('Unable to insert into table '.$db_prefix.'posts. Please check your configuration and try again', __FILE__, __LINE__, $db->error());

	// Index the test post so searching for it works
	require DBC_ROOT.'engine/search_idx.php';
	$DBC_config['o_default_lang'] = $default_lang;
	update_search_index('post', 1, $message, $subject);

	$db->end_transaction();


	$alerts = array();
	// Check if the cache directory is writable
	if (!@is_writable('./engine/cache/'))
		$alerts[] = '<strong>The cache directory is currently not writable!</strong> In order for Delux Board Conversations to function properly, the directory named <em>cache</em> must be writable by PHP. Use chmod to set the appropriate directory permissions. If in doubt, chmod to 0777.';

	// Check if default avatar directory is writable
	if (!@is_writable('./uploads/fotos'))
		$alerts[] = '<strong>The avatar directory is currently not writable!</strong> If you want users to be able to upload their own avatar images you must see to it that the directory named <em>img/avatars</em> is writable by PHP. You can later choose to save avatar images in a different directory (see Admin/Options). Use chmod to set the appropriate directory permissions. If in doubt, chmod to 0777.';

	// Check if we disabled uploading avatars because file_uploads was disabled
	if ($avatars == '0')
		$alerts[] = '<strong>File uploads appear to be disallowed on this server!</strong> If you want users to be able to upload their own avatar images you must enable the file_uploads configuration setting in PHP. Once file uploads have been enabled, avatar uploads can be enabled in Administration/Options/Features.';

	// Add some random bytes at the end of the cookie name to prevent collisions
	$cookie_name = 'DBC_cookie_'.random_key(6, false, true);

	// Generate the config.php file data
	$config = generate_config_file();

	// Attempt to write config.php and serve it up for download if writing fails
	$written = false;
	if (is_writable(DBC_ROOT))
	{
		$fh = @fopen(DBC_ROOT.'engine/data/config.php', 'wb');
		if ($fh)
		{
			fwrite($fh, $config);
			fclose($fh);

			$written = true;
		}
	}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Delux Board Conversations Installation</title>
<link rel="shortcut icon" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="templates/Default/css/style.css" />
</head>
<body>


<div id="DBCinstall" class="DBC_2">
<div class="top-box"><div><!-- Top Corners --></div></div>
<div class="DBCwrap">

<div id="brdmain">
			<h1><span>Установщик Delux Board Conversations</span></h1>
			<div id="brddesc"><p>Delux Board Conversations установлен успешно.</p></div>
</div>

	<h2><span>Финальная инструкция</span></h2>
	<div class="box">
<?php

if (!$written)
{

?>
		<form method="post" action="install.php">
			<div class="inform">
				<div class="forminfo">
					<p>To finalize the installation, you need to click on the button below to download a file called config.php. You then need to upload this file to directory /engine/ of your Delux Board Conversations installation.</p>
					<p>Once you have uploaded config.php, Delux Board Conversations will be fully installed! At that point, you may <a href="index.php">go to the forum index</a>.</p>
				</div>
				<input type="hidden" name="generate_config" value="1" />
				<input type="hidden" name="db_type" value="<?php echo $db_type; ?>" />
				<input type="hidden" name="db_host" value="<?php echo $db_host; ?>" />
				<input type="hidden" name="db_name" value="<?php echo DBC_htmlspecialchars($db_name); ?>" />
				<input type="hidden" name="db_username" value="<?php echo DBC_htmlspecialchars($db_username); ?>" />
				<input type="hidden" name="db_password1" value="<?php echo DBC_htmlspecialchars($db_password1); ?>" />
				<input type="hidden" name="db_prefix" value="<?php echo DBC_htmlspecialchars($db_prefix); ?>" />
				<input type="hidden" name="cookie_name" value="<?php echo DBC_htmlspecialchars($cookie_name); ?>" />
				<input type="hidden" name="cookie_seed" value="<?php echo DBC_htmlspecialchars($cookie_seed); ?>" />

<?php if (!empty($alerts)): ?>				<div class="forminfo error-info">
					<ul class="error-list">
<?php

foreach ($alerts as $cur_alert)
	echo "\t\t\t\t\t".'<li>'.$cur_alert.'</li>'."\n";
?>
					</ul>
				</div>
<?php endif; ?>			</div>
			<p class="buttons"><input type="submit" value="Download config.php file" /></p>
		</form>

<?php

}
else
{
?>
		<div class="fakeform">
			<div class="inform">
				<div class="forminfo">
					<p>Форум Delux Board Conversations установлен успешно! Перейти на <a href="index.php">главную страницу</a>.</p>
					<p>В случае возникновения проблем советуем вам обратится в <a href="http://dbc-forum.com/support/forum_2">данный раздел</a> форума.</p><br/><br/>
					<p align="right"><span id="copyright">2011 © Под управлением Delux Board Conversations</span></p>
				</div>
			</div>
		</div>
<?php

}

?>
	</div>
<DBC_footer>

</div>
<div class="end-box"><div><!-- Bottom Corners --></div></div>
</div>


</body>
</html>
<?php

}